/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.classdiagram.tabbedproperties.filters;

import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Generalization;
import org.eclipse.uml2.uml.PackageImport;
import org.eclipse.uml2.uml.ProfileApplication;
import org.eclipse.uml2.uml.Slot;
import org.eclipse.uml2.uml.TemplateBinding;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.TemplateParameterSubstitution;
import org.eclipse.uml2.uml.TemplateSignature;

import com.cea.papyrus.core.tabbedproperties.UMLElementFilter;

/**
 * this filter is used to select only element what can be displayed the name
 */
public class NameSectionFilter extends UMLElementFilter {

   /**
    * {@inheritDoc}
    */
	public boolean select(Object object) {
    	
    	if (!super.select(object)) {
    		return false;
    	}
    	// Special cases
        if (	(element instanceof Generalization)
        		|| (element instanceof Comment)
        		|| (element instanceof PackageImport)
        		|| (element instanceof ProfileApplication)
        		|| (element instanceof Slot)
        	    || (element instanceof TemplateSignature)
        	    || (element instanceof TemplateParameter)
        	    || (element instanceof TemplateBinding)
        	    || (element instanceof TemplateParameterSubstitution)) {
        	return false;      	
        }
        // else 
        return true;
    }
}
